﻿namespace Acl.Messages;

/// <summary>
/// 分布式消息订阅器
/// </summary>
public interface IDistributionMessageSubscriber
{
    /// <summary>
    /// 订阅
    /// </summary>
    /// <param name="topic">消息主题</param>
    /// <param name="action"></param>
    /// <param name="options"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task Subscribe<TData>(string topic, Action<IDistributionMessage<TData>> action, DistributionSubscribeOptions? options = default, CancellationToken cancellationToken = default);
}
